<div class="content">
    <div class="tl-img"><a class="pergunta"></a></div>
    <h1>Dados da Compra</h1>


    <div class="carrinho" style="margin: 0 20px;">
        <div class="divProdutospeq">
            <h2>Produto</h2>
            <table class="tbProdutos">
                <tbody>
                     <?php 
                    $total = 0;    
                    foreach ($this->row as $row) { 
                        $cur_id = $row->CUR_ID;
                        
                        $hoje = strtotime(date('Y-m-d'));
                        $datapro = strtotime($row->CUR_PROMDAT);
                        $valor = $row->CUR_VLR;
                        if($datapro >= $hoje){
                            $valor = $row->CUR_PROM;
                        }
                        $total += $valor;
                    ?>
                    <tr>
                        <td>
                            <h3><?php echo $row->CUR_NOM; ?></h3>
                        </td>
                        <td width="125px" align="center">R$ <?php echo tools::float_to_money($valor); ?></td>
                    </tr>
                    <?php } ?>
                    <tr>
                        <td><strong>TOTAL</strong></td>
                        <td align="center"><strong>R$ <?php echo tools::float_to_money($total); ?></strong></td>
                    </tr>
                </tbody>
            </table>
        </div>
        <?php 
        
        $obj = new Ead_Model_DbTable_Cursoforma();
        $row = $obj->fetchAll('CUR_ID = '.(int)$cur_id);
        $arr_set = array();
        foreach($row as $r) $arr_set[$r['FOR_ID']] = $r['FOR_ID'];
        
        $obj = new Ead_Model_DbTable_Formaspagamento();
        $rfp = $obj->fetchAll()->toArray();
        ?>
        <div class="titulo">Opções de pagamento</div>
        <div class="d_op_pag">
           <?php foreach($rfp as $rp){ 
               if(array_search($rp['FOR_ID'], $arr_set) !== FALSE){
           ?>            
            <label><input type="radio" name="op_pag" value="<?php echo $rp['FOR_COD']?>" class="op_pag" /> <?php echo $rp['FOR_NOM']?></label>
           <?php 
                }
            } /* 
            <label><input type="radio" name="op_pag" value="C" class="op_pag" /> Cheque</label>
            <label><input type="radio" name="op_pag" value="D" class="op_pag" /> Depósito Bancário</label>
            <label><input type="radio" name="op_pag" value="P" class="op_pag" /> Pagseguro</label>
            */ ?>
            <div class="op_pag_res"></div>
            
        </div>    
        
        <div id="cfm_compra">
            <div class="content-loader"><img class="loader" src='<?php echo $this->urlbase; ?>/public/media/images/loader.gif' /></div>
            <button type="button" id="btn-compra" class="btn-compra"> Efeutar o Pagamento</button>
        </div>
        
    </div>
</div>

<div id="dialog"></div>